<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
</head>
<body>
<div>
    <div>用户名：<input id="username"/></div>
    <div>密码：<input id="password"/></div>
    <div><input id="btnLogin" type="button" value="登录"/></div>
</div>

</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script>

    $(document).ready(function () {
         $('#btnLogin').bind('click',function () {
             $.ajax({
                 url:'http://localhost:3000/user/login',
                 method:'post',
                 dataType:'json',
                 data:{
                     username:$('#username').val(),
                     password:$('#password').val()
                 },
                 success:function (data) {
                     if (data.isSuccess){
                         alert('登录成功');
                     }else {
                         alert('登录失败');
                     }
                 }
             })
         })
    })

</script>
</html>
